all: FTP_client FTP_server  
  
FTP_client: libclient.a  
	gcc FTP_client.c -o FTP_client -I../inc -L. -lclient  
	mv libclient.a ../lib/  
  
FTP_server: libserver.a  
	gcc FTP_server.c -o FTP_server -I../inc -L. -lserver  
	mv libserver.a ../lib/  
  
libclient.a: message.o pack.o unpack.o  
	ar -rc libclient.a message.o pack.o unpack.o  
  
libserver.a: message.o pack.o unpack.o  
	ar -rc libserver.a message.o pack.o unpack.o  
  
%.o: %.c  
	gcc -c $< -o $@ -pthread -I../inc  
  
clean:  
	rm -f *.o  
	rm -f ../lib/libclient.a ../lib/libserver.a  
	rm -f FTP_client FTP_server  
  
.PHONY: all clean